<script>
  $(document).ready(function(){
     $("#mod_id").change(function(){
         $("#complete_form").submit();
     })
  })
</script>
		<div id="center-column">
			<div class="top-bar">
				<a href="<?php echo  base_url();?>model/complete_add" class="button">新增</a>
				<h1>Contents</h1>
				<div class="breadcrumbs"><a href="#">首页</a> / <?php echo anchor('model/complete','型号资料管理');?></div>
			</div><br />
		  <div class="select-bar">
		  <?php echo form_open('model/complete',array('id'=>'complete_form'));?> 
		    <label>型号：</label><label><select id="mod_id" name="mod_id">
		                      <option value="">全部型号</option>
		                   <?php foreach($mod as $k=>$val){?>
		                      <option value="<?php echo $val->mod_id;?>" <?php if(isset($mod_id)&&($mod_id==$val->mod_id)){?>selected=true<?php }?>><?php echo $val->name;?></option>
		                   <?php }?>
		                 </select>
		    </label>
		    <label>
		    <input type="text" name="textfield" />
		    </label>
		    <label>
			<input type="submit" name="Submit" value="搜索" />
			</label>
		  </form>	
		  </div>
			<div class="table">
				
				
				<table class="listing" cellpadding="0" cellspacing="0">
					<tr>
						<th class="first" width="30">ID</th>
						<th>资料类别</th>
						<th width="100">套别名称</th>
						<th width="70">套别编码</th>
						<th class="last" width="130">操作</th>
					</tr>
			    <?php foreach($complete as $k=>$val):?>		
					<tr>
                        <td><?php echo $start;?></td>                        
                        <td style="text-align:left;"><?php $ids=explode(',',$val->category_ids);foreach($category as $j=>$m){ foreach($ids as $d=>$l){ if($l==$m->category_id){?><p style="width:180px;float:left;line-height:15px;"><?php echo $m->name."&nbsp;&nbsp;&nbsp;";?></p><?php }} }?></td>
                        <td><?php echo $val->name;?></td>
                        <td><?php echo $val->codes;?></td>
                        <td><?php echo anchor('model/complete_detail/'.$val->complete_id,'查看',array('class'=>'complete_detail'));?>&nbsp;&nbsp;|&nbsp;&nbsp;<?php echo anchor('model/complete_edit/'.$val->complete_id,'编辑',array('class'=>'mod_edit'));?>&nbsp;&nbsp;|&nbsp;&nbsp;<?php echo anchor('model/complete_del/'.$val->complete_id,'删除',array('class'=>'mod_edit',"onclick"=>"return confirm('您确定要删除吗？')?true:false;"));?></td>
					</tr>
				<?php $start++;endforeach;?>						
				</table>
				<?php echo $page;?>
			</div>
		</div>
	</div>
	<div id="footer"></div>
</div>


</body>
</html>
